package com.kaigejava.iterator.iterator;

import com.kaigejava.iterator.MenuItem;

import java.util.ArrayList;

/**
 * Created by kaigejava on 2019/9/7.
 */
public class WaitressIterator {
    private ArrayList<Iterator> iterators=new ArrayList<Iterator>();
    public WaitressIterator() {}
    public void addIterator(Iterator iterator){
        iterators.add(iterator);
    }
    public void printMenu() {
        Iterator iterator;
        MenuItem menuItem;
        for (int i = 0, len = iterators.size(); i < len; i++) {
            iterator = iterators.get(i);
            while(iterator.hasNext()) {
                menuItem=(MenuItem)	iterator.next();
                System.out.println(menuItem.getName() + "***"
                        +menuItem.getPrice()+"***"+ menuItem.getDescription());
            }

        }
    }

    public void printBreakfastMenu() {

    }

    public void printLunchMenu() {

    }

    public void printVegetableMenu() {

    }
}
